#!/bin/sh
classpath="./conf:./static"
for file in lib/*.jar
do
  if [[ ! -f "$file" ]]
  then
      continue
  fi
  classpath="$classpath:$file"
done
echo $classpath
JAVA_OPTS="-Duser.timezone=GMT+08 -Xms2g -Xmx4g"
AGENT_OPTS=""
if [ -f lib/sharelibs-health*.jar ];then
    healthAgent=`ls -lrt lib/sharelibs-health-*.jar |awk -F" " '{print $NF}'`
    AGENT_OPTS="$AGENT_OPTS  -javaagent:$healthAgent"
fi

if [ -f lib/mlog-log*.jar ];then
    logAgent=`ls -lrt lib/mlog-log*.jar |awk -F" " '{print $NF}'`
    AGENT_OPTS="$AGENT_OPTS  -javaagent:$logAgent=catch_error=true"
fi
export AGENT_OPTS
export classpath
export JAVA_OPTS